package com.rxkj.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.rxkj.entity.rainwater.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
@Mapper
public interface WaterAndRainMapper {


    @DS("hongdian")
    List<WaterAndRainVO> getDevWaterRainPage(@Param("start") int start, @Param("end") int end, @Param("stnm") String stnm);

    @DS("hongdian")
    Long getDevTotalRows(@Param("stnm") String stnm);

    @DS("hongdian")
    @Select("SELECT TERM_SN termsn, IMG_PATH imgpath, IMAGE_NAME imgname, IMAGE_TIME tm " +
            "FROM biz_station_image WHERE TERM_SN = #{termsn} ORDER BY SYS_TIME DESC LIMIT 1")
    @ResultType(ImageSt.class)
    ImageSt getImageByTermsn(@Param("termsn") String termsn);

    @DS("hongdian")
    Long getRainTotalRows(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    Long getWaterTotalRows(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    Long getImageTotalRows(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<RainSt> getRainPage(@Param("start") int start, @Param("end") int end, @Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<WaterSt> getWaterPage(@Param("start") int start, @Param("end") int end, @Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<ImageSt> getImagePage(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<RainSt> getRainData5(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<RainSt> getRainData60(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<RainSt> getRainData24(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @DS("hongdian")
    List<RainSt> getRainDatax24(@Param("termsn") String termsn, @Param("endTime") String endTime);

    @DS("hongdian")
    List<WaterSt> getWaterData(@Param("termsn") String termsn, @Param("startTime") String startTime, @Param("endTime") String endTime);

    @Select("select xunxian, kurong from station where stcdcode = #{termsn}")
    @ResultType(StationInfo.class)
    StationInfo getStationxByTermsn(@Param("termsn") String termsn);
}
